package bank_access;

import mware_lib.IProxy;
import mware_lib.ISkeleton;
import mware_lib.ProxyCache;

public abstract class AccountImplBase implements IProxy {
  public abstract void transfer(double amount) throws OverdraftException;
  public abstract double getBalance();
  
  public static ProxyCache<AccountProxy> cache = new ProxyCache<>(AccountProxy.class);
  
  public static AccountImplBase narrowCast(Object rawObjectRef) {
    return cache.returnCached(rawObjectRef);
  }

  @Override
  public ISkeleton getSkeleton() {
    return new AccountSkeleton(this);
  }
}